//
//  LeWindow.h
//  Leste
//
//  Created by 王乐 on 2022/1/27.
//

#ifndef LeWindow_hpp
#define LeWindow_hpp


class GLFWwindow;

// The right way for callbacks is to send the function pointers as parameters to LeWindow, and register them in initWindow().
// So that different window can initialize with different callback functions.
// But for simplicity, I just write them here.
static void framebuffer_size_callback(GLFWwindow* window, int width, int height);
static void mouse_callback(GLFWwindow* window, double xpos, double ypos);
static void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);

class LeWindow
{
public:
    LeWindow();
    ~LeWindow();
    
public:
    int initWindow();
    void configureGlobalOpenGLState();
    bool shouldCloseWindow();
    void setShouldCloseWindow(bool bclose);
    void configureRenderingOpenGL(float r, float g, float b, float a);
    void swapWindowBuffers();
    void pollWindowEvents();
    void terminateWindow();
    
    GLFWwindow* getWindow();
    
private:
    GLFWwindow* window;
};

#endif /* LeWindow_hpp */
